home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1997-01-30 | 2.3 KB | 51 lines | [TEXT/3PRM] |
- implementation module dialogUpdate;
-
-
- import StdClass; // RWS
- import StdBool, StdInt, StdString, StdChar;
- import OS_utilities, quickdraw, menus, events, windows, dialogs;
- import dialogAccess, dialogInternal, dialogAbout, ioState;
-
-
- DialogUpdateError :: String String -> .x;
- DialogUpdateError f error = Error f "dialogUpdate" error;
-
- // Handle dialog updates (i.e. redraw Controls and IconButtons).
-
- ForceDialogUpdate :: !(DialogRep s (IOState s)) !Toolbox -> Toolbox;
- ForceDialogUpdate dRep=:(DialogH id tt md rect ps is rt, dPtr) tb
- = UpdateDialog dRep (InGrafport2 dPtr (ValidRect rect) tb2);
- where {
- (tickCount, tb1) = TickCount tb;
- (b,dPtr1,itemNr,tb2) = DialogSelect (UpdateEvent, dPtr, tickCount, 0, 0, 1) tb1;
- };
-
- UpdateDialog :: !(DialogRep s (IOState s)) !Toolbox -> Toolbox;
- UpdateDialog (DialogH _ _ _ _ popUpHs items (DialogRest _ _ defId), ptr) tb
- = UpdateItems defId popUpHs items ptr tb;
-
- UpdateItems :: !DialogItemId ![PopUpHandle] ![DialogItem s (IOState s)] !DialogPtr !Toolbox -> Toolbox;
- UpdateItems defid popups [DialogButton id box tt ab bf : rest] ptr tb
- | defid == id = UpdateItems defid popups rest ptr (DrawDefButtonOutline box ptr tb);
- = UpdateItems defid popups rest ptr tb;
- UpdateItems defid popups [DialogIconButton id box domain look select bf : rest] ptr tb
- = UpdateItems defid popups rest ptr (RedrawIconOrControl box domain (look select) ptr tb);
- UpdateItems defid popups [Control id box domain select state look cf df : rest] ptr tb
- = UpdateItems defid popups rest ptr (RedrawIconOrControl box domain (look select state) ptr tb);
- UpdateItems defid popups [DialogPopUp id box select di buts : rest] ptr tb
- = UpdateItems defid popups rest ptr (RedrawPopUp box select itemtext ptr tb);
- where {
- (itemtext,ab,df)= GetRadioButtonInfo di buts;
- (i,m) = GetPopUpHandle id popups;
- };
- UpdateItems defid popups [item : rest] ptr tb = UpdateItems defid popups rest ptr tb;
- UpdateItems _ _ _ _ tb = tb;
-
- GetRadioButtonInfo :: !DialogItemId ![RadioItemDef s (IOState s)]
- -> (!ItemTitle, !SelectState, !DialogFunction s (IOState s));
- GetRadioButtonInfo bid [RadioItem id title ab df : rest]
- | bid == id = (title,ab,df);
- = GetRadioButtonInfo bid rest;
- GetRadioButtonInfo bid _
- = DialogUpdateError "GetRadioButtonInfo" ("Unknown item id: " +++ toString bid);
-